package com.xishu.entity.shop;


import com.xishu.annotation.lang.Lang;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class ItemDetail implements Serializable {
    private static final long serialVersionUID = -7033661963747874013L;

    @ApiModelProperty(value = "唯一性")
    private Long id;

    @ApiModelProperty(value = "名称")
    @Lang(key = "name")
    private String name;

    @ApiModelProperty(value = "名称")
    @Lang(key = "name")
    private String name_zh;

    @ApiModelProperty(value = "名称")
    @Lang(key = "name")
    private String name_en;

    @ApiModelProperty(value = "内容描述，比如是大份，中份，小份，或者是微辣，中辣之类的以及对应的价格")
    private List<NameAndPrice> nameAndPriceList = new ArrayList<>();

    @ApiModelProperty(value = "是否是多选")
    private Boolean multi;

    @ApiModelProperty(value = "是否是必选")
    private Boolean required;

    @ApiModelProperty(value = "最小选择数")
    private Long minSelect;

    @ApiModelProperty(value = "最大选择数")
    private Long maxSelect;

    @ApiModelProperty(value = "如果是套餐选择的菜有规格，那么这里会添加对应菜的Id")
    private Long itemId;

    @ApiModelProperty(value = "竖着打印")
    private Boolean verticalPrint;

    public Boolean getVerticalPrint() {
        return verticalPrint;
    }

    public void setVerticalPrint(Boolean verticalPrint) {
        this.verticalPrint = verticalPrint;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName_zh() {
        return name_zh;
    }

    public void setName_zh(String name_zh) {
        this.name_zh = name_zh;
    }

    public String getName_en() {
        return name_en;
    }

    public void setName_en(String name_en) {
        this.name_en = name_en;
    }

    public Long getItemId() {
        return itemId;
    }

    public void setItemId(Long itemId) {
        this.itemId = itemId;
    }

    public Long getMinSelect() {
        return minSelect;
    }

    public void setMinSelect(Long minSelect) {
        this.minSelect = minSelect;
    }

    public Long getMaxSelect() {
        return maxSelect;
    }

    public void setMaxSelect(Long maxSelect) {
        this.maxSelect = maxSelect;
    }

    public List<NameAndPrice> getNameAndPriceList() {
        return nameAndPriceList;
    }

    public void setNameAndPriceList(List<NameAndPrice> nameAndPriceList) {
        this.nameAndPriceList = nameAndPriceList;
    }

    public Boolean getMulti() {
        return multi;
    }

    public void setMulti(Boolean multi) {
        this.multi = multi;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("ItemDetail{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", name_zh='").append(name_zh).append('\'');
        sb.append(", name_en='").append(name_en).append('\'');
        sb.append(", nameAndPriceList=").append(nameAndPriceList);
        sb.append(", multi=").append(multi);
        sb.append(", required=").append(required);
        sb.append(", minSelect=").append(minSelect);
        sb.append(", maxSelect=").append(maxSelect);
        sb.append(", itemId=").append(itemId);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ItemDetail that = (ItemDetail) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(nameAndPriceList, that.nameAndPriceList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, nameAndPriceList);
    }
}
